package org.jeecg.modules.demo.crm.dto;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.demo.crm.entity.*;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="项目详情", description="项目详情")
@Builder
@NoArgsConstructor // 自动生成无参构造方法
@AllArgsConstructor // 自动生成全参构造方法
public class CProjectApplicationDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**id*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
    /**项目编号*/
    @Excel(name = "项目编号", width = 15)
    @ApiModelProperty(value = "项目编号")
    private String projectNumber;
    /**项目名称*/
    @Excel(name = "项目名称", width = 15)
    @ApiModelProperty(value = "项目名称")
    private String projectName;
    /**项目描述*/
    @Excel(name = "项目描述", width = 15)
    @ApiModelProperty(value = "项目描述")
    private String projectDescription;
    /**工程详细地址*/
    @Excel(name = "工程详细地址", width = 15)
    @ApiModelProperty(value = "工程详细地址")
    private String address;
    /**项目状态*/
    @Excel(name = "项目状态", width = 15, dicCode = "project_status")
    @Dict(dicCode = "project_status")
    @ApiModelProperty(value = "项目状态")
    private String projectStatus;
//    /**项目类型*/
//    @Excel(name = "项目类型", width = 15,dicCode = "project_type")
//    @ApiModelProperty(value = "项目类型")
//    @Dict(dicCode = "project_type")
//    private String projectType;
    /**发包单位*/
    @Excel(name = "发包单位", width = 15, dictTable = "c_contracting_unit", dicText = "name", dicCode = "id")
    @Dict(dictTable = "c_contracting_unit", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "发包单位")
    private String contractingUnit;
    /**所属库*/
    @Excel(name = "所属库", width = 15, dictTable = "c_library", dicText = "name", dicCode = "id")
    @Dict(dictTable = "c_library", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "所属库")
    private String libraryId;
    /**发包单位*/
    @Excel(name = "总包主体", width = 15, dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @Dict(dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @ApiModelProperty(value = "总包主体")
    private String companyInfoId;
    /**项目增项*/
    @Excel(name = "项目增项", width = 15, dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @Dict(dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @ApiModelProperty(value = "项目增项")
    private String additionalId;
    /**合同价*/
    @Excel(name = "合同价", width = 15)
    @ApiModelProperty(value = "合同价")
    private BigDecimal contractPrice;
    /**总项目报价*/
    @Excel(name = "总项目报价", width = 15)
    @ApiModelProperty(value = "总项目报价")
    private BigDecimal TotalProjectQuotation;
    /**打款总金额*/
    @Excel(name = "打款总金额", width = 15)
    @ApiModelProperty(value = "打款总金额")
    private BigDecimal payment;
    /**收到总金额*/
    @Excel(name = "收到总金额", width = 15)
    @ApiModelProperty(value = "收到总金额")
    private BigDecimal receivePrice;
    /**合同价是否含税价*/
    @Excel(name = "合同价是否含税价", width = 15,replace = {"是_Y","否_N"} )
    @ApiModelProperty(value = "合同价是否含税价")
    private java.lang.String taxIncluded;
    /**税率*/
    @Excel(name = "税率", width = 15)
    @ApiModelProperty(value = "税率")
    private BigDecimal taxRate;
    /**管理费*/
    @Excel(name = "管理费", width = 15)
    @ApiModelProperty(value = "管理费")
    private BigDecimal manageFee;
    /**项目来源*/
    @Excel(name = "项目来源", width = 15, dicCode = "application_source")
    @Dict(dicCode = "application_source")
    @ApiModelProperty(value = "项目来源")
    private String source;
    /**项目合同*/
    @Excel(name = "项目合同", width = 15)
    @ApiModelProperty(value = "项目合同")
    private String projectContract;
    /**项目图纸*/
    @Excel(name = "项目图纸", width = 15)
    @ApiModelProperty(value = "项目图纸")
    private String projectDrawings;
    /**计划工期（/天）*/
    @Excel(name = "计划工期（/天）", width = 15)
    @ApiModelProperty(value = "计划工期（/天）")
    private Integer duration;
    /**预计开始日期*/
    @Excel(name = "预计开始日期", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "预计开始日期")
    private Date startDate;
    /**预计结束日期*/
    @Excel(name = "预计结束日期", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "预计结束日期")
    private Date endDate;
    /**实际开工时间*/
    @Excel(name = "实际开工时间", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "实际开工时间")
    private Date actualStartTime;
    /**实际完工实际*/
    @Excel(name = "实际完工实际", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "实际完工实际")
    private Date actualCompletionTime;

    @Excel(name = "立项时间", width = 20, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "立项时间")
    private Date establishmentTime;
    /**附件URL*/
    @Excel(name = "附件URL", width = 15)
    @ApiModelProperty(value = "附件URL")
    private String attachmentUrl;
    /**关联文件记录ID*/
    @Excel(name = "关联文件记录ID", width = 15)
    @ApiModelProperty(value = "关联文件记录ID")
    private String fileRecordId;
    /**合并项目（只有增项的时候有）*/
    @Excel(name = "合并项目（只有增项的时候有）", width = 15)
    @ApiModelProperty(value = "合并项目（只有增项的时候有）")
    private String mergeProjectId;

    @Excel(name = "合同关联", width = 15, dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    @Dict(dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    private String contractId;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private Integer subcontrCount;

    //质保金合计
    private BigDecimal totalGuaranteeDeposit;

    //费用报销
    private BigDecimal reimbursement;

    //项目收款（合计）
    private BigDecimal totalReceipts;

    //付款合计
    private BigDecimal paymentTotal;


    //收票金额
    private BigDecimal  receiptsTotal;
    //收票税额
    private BigDecimal  receiptsTaxTotal;
    //收票合计(元)
    private BigDecimal  receiptsAndTaxTotal;

    // 未收票金额
    private BigDecimal  uncollectedAmount;

    //开票付款
    private BigDecimal  invoicingTotal;
    //开票合计税额
    private BigDecimal totalTaxAmount;
    //开票合计(元)
    private BigDecimal totalInvoiceTax;
    //未开票金额
    private BigDecimal uninvoicedAmount;

    //未收款
    private BigDecimal UncollectedPayment;


    //子项目合同金额合计
    private BigDecimal subProjectAmount;



    //应交票税(元)
    private BigDecimal invoiceTaxPayable;

    /**
     * 项目未收款金额
     */
    private BigDecimal projectUncollectedPayment;

    /**
     * 子项未付款金额
     */
    private BigDecimal subProjectNonPayment;




    /**
     * 可用余额
     */
    private BigDecimal availableBalance;

    //   进度
    //开票进度
    private BigDecimal invoicingProgress;
    //收款进度
    private BigDecimal receivingProgress;
    //付款进度
    private BigDecimal paymentProgress;
    //子项目进度
    private BigDecimal subProjectProgress;

    //库
    private CLibrary library;

    //发包单位
    private CContractingUnit contractingUnitVo;

    //总包主体
    private CCompanyInfo companyInfo;

    //相关合同
    private List<CContract> contract;

    //子项目信息
    private List<CSubProject> cSubProjectList;

    //登陆者信息
    private LoginUser sysUser;
    //项目状态
    private List<CProjectStatusLog> projectStatusLogList;

}
